<html>
<head>
  <title>average.c</title>
</head>
<body bgcolor="#ffffff" text="#000000">
<pre>
<font color="0000ff"><strong>#include <font color="#008000">&lt;stdio.h&gt;</font></strong></font>
<font color="0000ff"><strong>#include <font color="#008000">&lt;stdlib.h&gt;</font></strong></font>

<strong>double</strong> <font color="#2040a0">ave</font><font color="4444FF">(</font> <strong>int</strong> <font color="#2040a0">n</font>, <strong>double</strong> <font color="4444FF">*</font><font color="#2040a0">array</font> <font color="4444FF">)</font><font color="4444FF">;</font>

<strong>double</strong> <font color="#2040a0">ave</font><font color="4444FF">(</font> <strong>int</strong> <font color="#2040a0">n</font>, <strong>double</strong> <font color="4444FF">*</font><font color="#2040a0">array</font> <font color="4444FF">)</font>
<font color="4444FF"><strong>{</strong></font>
  <strong>int</strong> <font color="#2040a0">i</font><font color="4444FF">;</font>
  <strong>double</strong> <font color="#2040a0">sum</font><font color="4444FF">;</font>
  <strong>for</strong><font color="4444FF">(</font> <font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font> <font color="4444FF">)</font>
  <font color="4444FF"><strong>{</strong></font>
    <font color="#2040a0">sum</font> <font color="4444FF">+</font><font color="4444FF">=</font> <font color="#2040a0">array</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">;</font>
  <font color="4444FF"><strong>}</strong></font> 
  <strong>return</strong> <font color="4444FF">(</font><strong>double</strong><font color="4444FF">)</font><font color="4444FF">(</font> <font color="#2040a0">sum</font> / <font color="#2040a0">n</font> <font color="4444FF">)</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font>

</pre>
<hr>
syntax highlighted by <a href="http://www.palfrader.org/code2html">Code2HTML</a>, v. 0.9.1
</body>
</html>
